package com.sec.android.app.myfiles.facade.cmd;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;

import org.puremvc.java.multicore.interfaces.INotification;
import org.puremvc.java.multicore.patterns.command.SimpleCommand;

public class ContactUsCmd extends SimpleCommand {
    private static final String TAG = "ContactUsCmd";

    @Override
    public void execute(INotification notification) {
        Object[] params = (Object[]) notification.getBody();
        Context context = (Context) params[0];

        Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("voc://view/contactUs"));
        intent.putExtra("packageName", context.getPackageName());
        intent.putExtra("appId", "kj1x691nkt");
        intent.putExtra("appName", "SecMyFiles");
        intent.putExtra("feedbackType", "ask");
        intent.putExtra("preloadBody", false);
        startIntent(intent, context);
    }

    public void startIntent(Intent intent, Context context) {
        if (intent.resolveActivity(context.getPackageManager()) != null) {
            context.startActivity(intent);
        }
    }
}
